<?php
$back_link = $_SERVER['HTTP_REFERER'];
$karyawan_id = check_karyawan_by_nik($_GET['nik_karyawan']);
if(!$karyawan_id){
	my_direct($back_link);
}
$parse = end(explode("?" , $back_link));
$params = explode("&",$parse);
$newlink = '';
foreach($params as $param){
	list($key,$val) = explode("=",$param);
	if($key =='karyawan_id'){
		$newlink.='&'.$key.'='.$karyawan_id ;
	}elseif($key =='id'){
		$newlink.='&'.$key.'='.$karyawan_id ;
	}else{
		if(trim($key) <>'')
		$newlink.='&'.$key.'='.$val;
	}
}
my_direct('index.php?'.$newlink);
exit;